//B-M

import java.util.*;

public class B_M {
    StringBuilder seq;
    public B_M(String seq) {
        this.seq = new StringBuilder(seq);
    }
    public void generate() {
        List<StringBuilder> fx = new ArrayList<>();
        List<Integer> ll = new ArrayList<>();
        int n = 0;
        int len = seq.length();
        fx.add(new StringBuilder("1"));
        ll.add(0);
        while(n < len) {
            int d = divide(seq, fx.get(n), ll.get(n), n);
            if(d == 0) {
                fx.add(fx.get(n));
                ll.add(ll.get(n));
            }else {
                if(ll.get(n) == 0) {
                    StringBuilder p = new StringBuilder();
                    p.append(1);
                    for(int i = 1; i < n+1; i++)
                        p.append(0);
                    p.append(1);
                    fx.add(p);

                    ll.add(n + 1);
                } else {
                    int m = n - 1;
                    while(ll.get(m) == ll.get(m + 1))
                        m -= 1;
                    StringBuilder p = getf(fx.get(n), fx.get(m), n - m);
                    fx.add(p);
                    int t = Math.max(ll.get(n), n+1-ll.get(n));
                    ll.add(t);
                }
            }
            
            n++;
        }
        System.out.println(fx.get(n) + " " + ll.get(n));
    }

    private static int divide(StringBuilder seq, StringBuilder c, int l, int n) {
        if(l == 0)
            return toint(seq.charAt(n));
        else{
            int d = toint(seq.charAt(n));
            for(int i = 0; i < l; i++) {
                if(c.charAt(i + 1) == '1') {
                    d += toint(seq.charAt(n - i -1));
                    d = d%2;
                }
            }
            return d;
        }
    }

    private static int toint(char ch) {
        return ch - '0';
    }

    private static StringBuilder getf(StringBuilder n, StringBuilder m, int div) {
        StringBuilder tmp = new StringBuilder();
        for(int i = 0; i < div; i++)
            tmp.append(0);
        tmp.append(m);
        if(n.length() > tmp.length()) {
            for(int i = tmp.length() - 1; i >= 0; i--) {
                if(tmp.charAt(i) != '0') {
                    int t = (toint(n.charAt(i)) + 1)%2;
                    char ch = (t == 0 ? '0' : '1');
                    n.setCharAt(i, ch);
                }
            }
            return n;
        } else {
            for(int i = n.length() - 1; i >= 0; i-- ) {
                if(n.charAt(i) != '0') {
                    int t = (toint(tmp.charAt(i)) + 1)%2;
                    char ch = t == 0 ? '0' : '1';
                    tmp.setCharAt(i, ch);
                }
            }
            return tmp;
        } 
    }

    public static void main(String[] args) {
        B_M b = new B_M(args[0]);
        b.generate();
    }
}
